/*
*
* Copyright (c) 2011 Vaulting Systems International
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy 
* of this software and associated documentation files (the "Software"), to deal 
* in the Software without restriction, including without limitation the rights 
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
* of the Software, and to permit persons to whom the Software is furnished to do  
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all  
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
package com.ekeyman.ws.service.impl;

import com.ekeyman.ws.service.EkeymanService;
import com.ekeymanlib.business.KeyManager;
import com.ekeymanlib.dto.AppDeviceApiKeys;
import com.ekeymanlib.dto.EncryptionKeys;


public class EkeymanServiceImpl implements EkeymanService{
	
	public EkeymanServiceImpl(){}

	private KeyManager keyManager;
	
	public EncryptionKeys createEncryptionKeys(String resourceUri, 
			String publicKey, int keyBytesLength, int ivBytesLength, 
			int saltBytesLength, int iterationCountMax, 
			String location, String digitalSignature) {

		return getKeyManager().createEncryptionKeys(resourceUri, 
				publicKey, keyBytesLength, ivBytesLength, 
				saltBytesLength, iterationCountMax, 
				location, digitalSignature);
	}

	public EncryptionKeys getEncryptionKeys(String resourceUri,
			String publicKey, String location, String digitalSignature){
		
		return getKeyManager().getEncryptionKeys(resourceUri, 
				publicKey, location, digitalSignature);
	}

	public void deleteEncryptionKeys(String resourceUri, 
			String publicKey, String location, String digitalSignature){
		
		getKeyManager().deleteEncryptionKeys(resourceUri, 
				publicKey, location, digitalSignature);
	}

	public AppDeviceApiKeys registerAppDevice(String apiKey, 
			String application, String device){
		
		return getKeyManager().registerAppDevice(apiKey, application, device);
	}
		
	public void setKeyManager(KeyManager keyManager) {
		this.keyManager = keyManager;
	}

	public KeyManager getKeyManager() {
		return keyManager;
	}
}
